package acwing._2LanQiao._5BinaryIndexedTree_SegmentTree;
/**
 * @Project : ProgrammingExercises
 * @Package : ACWing._2LanQiao._5BinaryIndexedTree_SegmentTree
 * @File : Q1237.java
 * @Author : WangRuoyu
 * @Date : 2023/3/18 9:10
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q1237 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");

        int x = Integer.parseInt(words[0]);
        int y = Integer.parseInt(words[1]);
        long res = 0;

        if (x >= 0 && y >= 0) {
            int n = Math.max(x, y);
            res = (2L * n) * (2L * n) + (long) (x - y);
        } else if (x <= 0 && y >= 0) {
            int n = Math.max(-x, y);
            res = (2L * n) * (2L * n - 1) + (long) (x + y);
        } else if (x >= 0 && y <= 0) {
            int n = Math.max(x, -y);
            res = (2L * n) * (2L * n + 1) + (long) (-x - y);
        } else {
            int n = Math.max(-x, -y + 1);
            res = (2L * n - 1) * (2L * n - 1) + (long) (y - x - 1);
        }
        System.out.println(res);
    }
}

//public class Q1237 {
//    public static void main(String[] args) throws IOException {
//        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//        String[] words = br.readLine().split(" ");
//
//        int x = Integer.parseInt(words[0]);
//        int y = Integer.parseInt(words[1]);
//        long res = 0;
//
//        int xcount = 0;
//        int ycount = 0;
//        if (Math.abs(x) > Math.abs(y)) {
//            if (x < 0) {
//                xcount = (-x << 1) - 1;
//                ycount = xcount - 1;
//                int yy = x + 1;
//                res = ((long) (1 + xcount) * xcount >> 1) + ((long) (1 + ycount) * ycount >> 1) + y - yy;
//                System.out.println(res);
//            } else {
//                xcount = x << 1;
//                ycount = xcount - 1;
//                int yy = x;
//                res = ((long) (1 + xcount) * xcount >> 1) + ((long) (1 + ycount) * ycount >> 1) + yy - y;
//                System.out.println(res);
//            }
//        } else if (Math.abs(x) < Math.abs(y)) {
//            if (y < 0) {
//                ycount = (-y << 1);
//            } else {
//                ycount = (y << 1) - 1;
//            }
//            xcount = ycount;
//            int xx = -y;
//            res = ((long) (1 + xcount) * xcount >> 1) + ((long) (1 + ycount) * ycount >> 1) + Math.abs(xx - x);
//            System.out.println(res);
//        } else {
//            if (x * y >= 0) {
//                System.out.println((x + y) * (x + y));
//            } else {
//                System.out.println((x - y) * (x - y) + 2 * x);
//            }
//        }
//    }
//}

